﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BatchUpdateRoleStatus.aspx.cs" Inherits="Presention.BatchUpdateRoleStatus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="Panel1" runat="server" GroupingText ="Search Role">
        Role Name&nbsp;
        <asp:TextBox ID="txtRolename" runat="server"></asp:TextBox>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 


        Status&nbsp;
        <asp:DropDownList ID="DropDownList1" runat="server" Height="20px" Width="134px"
        DataTextField="StatusName" 
            DataValueField="StatusId" >
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


        <asp:Button ID="Button1" runat="server" Text="Search" onclick="Button1_Click" />

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        
    </asp:Panel>


    <asp:Panel ID="Panel2" runat="server" GroupingText = "Role List">
<script language="javascript" type="text/jscript">
    function GetAllCheckBox(CheckAll) {

        var items = document.getElementsByTagName("input");
        for (i = 0; i < items.length; i++) {
            if (items[i].type == "checkbox") {
                items[i].checked = CheckAll.checked;
            }
        }
    }
</script>


        <asp:Button ID="addrole" runat="server" Text="Creat New Role" Width="146px" 
            onclick="addrole_Click" />
        &nbsp;&nbsp;
        <asp:Button ID="btninuse" runat="server" Text="BatchUpdate(in use)" 
            Width="146px" onclick="btninuse_Click" />
        &nbsp;&nbsp;
        <asp:Button ID="btnnouse" runat="server" Text="BatchUpdate(no use)" 
            Width="146px" onclick="btnnouse_Click" />


         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <div>
            <table border="1" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" bgcolor="#999999" height="25" valign="middle" width="50">
                        select</td>
                    <td align="center" bgcolor="#999999" valign="middle" width="80">
                        Role Id</td>
                    <td align="center" bgcolor="#999999" valign="middle" width="300">
                        Role Name</td>
                    <td align="center" bgcolor="#999999" valign="middle" width="150">
                        Status</td>
                    <td align="center" bgcolor="#999999" valign="middle" width="120">
                        Tool</td>
                </tr>
                <asp:Repeater ID="rptlist" runat="server" OnItemCommand="Repeater1_ItemCommand" 
                    OnItemDataBound="Repeater1_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td align="center" height="25" valign="middle" width="50">
                                <asp:CheckBox ID="chks" runat="server" />
                                <asp:HiddenField ID="HiddenField1" runat="server" 
                                    Value='<%# Eval("RoleId") %>' />
                            </td>
                            <td align="center" valign="middle" width="80">
                                <%# Eval("RoleId") %>
                            </td>
                            <td align="center" valign="middle" width="300">
                                <%# Eval("RoleName") %>
                            </td>
                            <td align="center" valign="middle" width="150">
                                <%# Eval("Status.StatusName")%>
                            </td>
                            <td align="center" valign="middle" width="200">
                                <asp:Button ID="btnupt" runat="server" CommandArgument='<%# Eval("RoleId") %>' 
                                    CommandName="upt" Text="Update" />
                                <asp:Button ID="btndel" runat="server" CommandArgument='<%# Eval("RoleId") %>' 
                                    CommandName="del" Text="Delete" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </div>

    </asp:Panel>

</asp:Content>
